﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/App.Master" Inherits="System.Web.Mvc.ViewPage<Ornament.MemberShip.User>" %>

<%@ Import Namespace="Ornament.Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Html.GetResourceString("CreateUser")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
        Html.BeginForm();%>
    <div class="buttonContainer">
        <button type="submit" id="saveButton">
            <%=Resources.Basic.Create %></button>
        <button id="backButton" type="button">
            <%=Resources.Basic.Cancel %></button>
    </div>
    <div id="CreateUser">
        <ul>
            <li><a href="#base">
                <%=Html.GetResourceString("tab_basicInfo") %></a> </li>
            <li><a href="#choose">
                <%=Html.GetResourceString("tab_option") %></a> </li>
            <li><a href="#2">
                <%=Html.GetResourceString("tab_choice_role") %></a></li>
            <li><a href="#usergroup">
                <%=Html.GetResourceString("tab_choice_userGroup") %></a></li>
        </ul>
        <div id="base" class="cssform">
            <div class="fieldItem">
                <%=Html.LabelFor(model => model.LoginId)%>
                <%=Html.TextBoxFor(model => model.LoginId)%>
                <%=Html.ValidationMessageFor(model=>model.LoginId) %>
            </div>
            <p>
                <%=Html.LabelFor(model => model.Information.Email)%>
                <%=Html.TextBoxFor(model => model.Information.Email)%>
                <%=Html.ValidationMessageFor(model=>model.Information.Email) %>
            </p>
            <p>
                <%=Html.LabelFor(model => model.Password)%>
                <%=Html.PasswordFor(model => model.Password)%>
                <%=Html.ValidationMessageFor(model=>model.Password) %>
            </p>
            <p>
                <label for="ConfirmPasswordTextBox">
                    <%=Resources.Basic.ConfirmPassword %>
                </label>
                <input id="ConfirmPasswordTextBox" type="password" />
            </p>
            <%if (Membership.RequiresQuestionAndAnswer)
              {%>
            <p>
                <%=Html.LabelFor(m=>m.PasswordQuestion)%>
                <%=Html.TextBoxFor(m => Model.PasswordQuestion)%>
                <%=Html.ValidationMessageFor(m=>Model.PasswordQuestion) %>
            </p>
            <p>
                <%=Html.LabelFor(m=>m.PasswordAnswer)%>
                <%=Html.TextBoxFor(m => Model.PasswordAnswer)%>
                <%=Html.ValidationMessageFor(m=>Model.PasswordAnswer) %>
            </p>
            <%
              }%>
        </div>
        <div id="choose" class="cssform">
            <p>
                <%=Html.LabelFor(m=>m.Name)%>
                <%=Html.TextBoxFor(m => m.Name)%>
                <%=Html.ValidationMessageFor(m=>m.Name) %>
            </p>
            <p>
                <%=Html.LabelFor(m=>m.Information.Phone)%>
                <%=Html.TextBoxFor(m => m.Information.Phone)%>
                <%=Html.ValidationMessageFor(m => m.Information.Phone)%>
            </p>
            <p>
                <%=Html.LabelFor(m=>m.Remark) %>
                <%=Html.TextAreaFor(m => m.Remark)%>
                <%=Html.ValidationMessageFor(m=>m.Remark) %>
            </p>
        </div>
        <div id="2">
            <%Html.Partial("../Role/RoleAssign", this.Model != null ? this.Model.GetAllRoles() : null); %>
        </div>
        <div id="usergroup">
            <%Html.RenderPartial("../UserGroups/UserGroupSelector", this.Model != null ? this.Model.GetUserGroups() : null); %>
        </div>
    </div>
    <%Html.EndForm();%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src='<%=Url.Content("~/Scripts/Lib/jquery.validate.min.js")%>'></script>
    <script type="text/javascript" src='<%=Url.Content("~/Scripts/Lib/jquery.unobtrusive-ajax.min.js")%>'></script>
    <script type="text/javascript" src='<%=Url.Content("~/Scripts/Lib/jquery.validate.unobtrusive.min.js")%>'></script>
    <script language="javascript" type="text/javascript">
    
    var passwordMinLength=<%=Membership.MinRequiredPasswordLength%>;
    var requiresQuestionAndAnswer=<%=Membership.RequiresQuestionAndAnswer.ToString().ToLower()%>;      
        
    $(document).ready(function() {        
        $('#CreateUser').tabs();       
        
        $("#backButton").button().click(function(){      
            location="Index";
         });
        $("#saveButton").button({icons:{primary:"ui-icon-plus"} }).click(function(){        
            return $.easyValidate('check');          
        });        
         
    });
  
    
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PageTitle" runat="server">
    创建用户
</asp:Content>
